package com.jucai.pppeiyouclient.comm;

import android.content.Context;
import android.os.Environment;

import com.jucai.pppeiyouclient.utils.LoginUtils;

/**
 * Created by UPC on 2017/3/31.
 */

public class CommonData {

    public final static String STORAGE_ROOT = Environment
            .getExternalStorageDirectory() + "/com.pppeiyou.client";

    /**
     * 缓存
     */
    public final static String STORAGE_CACHE = STORAGE_ROOT + "/cache";

    public final static String STORAGE_CACHE_FILE = "/com.pppeiyou.client" + "/cache/";
    /**
     * 照片
     */
    public final static String STORAGE_PHOTO = STORAGE_ROOT + "/photo";
    public final static String STORAGE_PHOTO_FILE = "/com.pppeiyou.client" + "/photo/";
    /**
     * 图片
     */
    public final static String STORAGE_PICTURE = STORAGE_ROOT + "/picture";
    public final static String STORAGE_PICTURE_FILE = "/com.pppeiyou.client" + "/picture/";
    /**
     * 聊天照片
     */
    public final static String STORAGE_PHOTO_CHAT = STORAGE_PHOTO + "/chat";
    public final static String STORAGE_PHOTO_CHAT_FILE = STORAGE_PHOTO_FILE + "/chat/";
    /**
     * 上传照片
     */
    public final static String STORAGE_PHOTO_UPLOAD = STORAGE_PHOTO + "/upload";
    public final static String STORAGE_PHOTO_UPLOAD_FILE = STORAGE_PHOTO_FILE + "/upload/";
    /**
     * 头像图片
     */
    public final static String STORAGE_PICTURE_HEAD = STORAGE_PICTURE + "/head";
    public final static String STORAGE_PICTURE_HEAD_FILE = STORAGE_PICTURE_FILE + "/head/";
    /**
     * 下载图片
     */
    public final static String STORAGE_PICTURE_DOWN = STORAGE_PICTURE + "/down";
    public final static String STORAGE_PICTURE_DOWN_FILE = STORAGE_PICTURE_FILE + "/down/";

    public static void saveLoginData(Context context, String member_id, String member_phone, String token, String rongyun_token) {
        LoginUtils.saveMember_id(context, member_id);
        LoginUtils.saveMember_phone(context, member_phone);
        LoginUtils.saveToken(context, token);
        LoginUtils.saveRongyun_token(context, rongyun_token);
    }


    public static void clearLoginData(Context context) {
        LoginUtils.saveMember_id(context, "");
        LoginUtils.saveMember_nickname(context, "");
        LoginUtils.saveMember_phone(context, "");
        LoginUtils.saveMember_avatar(context, "");
        LoginUtils.saveToken(context, "");
        LoginUtils.saveRongyun_token(context, "");
    }

}
